<template>
    <div>
        <p>我是A组件</p>
        <B :books="books">
            <template slot-scope="slotProps" slot="bookInfo">
                <span v-if="slotProps.book.sale">限时优惠</span>
                {{ slotProps.book.name }}
            </template>
        </B>

    </div>
</template>
   
<script>
import B from './B.vue'
export default {
    name: 'A',
    components: {      //注册B组件
        B
    },
    data() {
        return {

        }
    }
}
</script>